﻿namespace NKernel.Core.Provider
{
    using System.Collections.Generic;

    using Impl;

    /// <summary>
    /// Description of IKernelProvider.
    /// All KernelProvider implementations must have a default constructor for instantiations
    /// </summary>
    public interface IKernelProvider
    {
        #region Methods

        /// <summary>
        /// Automatically assembles the components
        /// </summary>
        /// <param name="componentDescriptors"></param>
        /// <param name="kernel">Instance of the kernel to be added to the provider/container</param>
        /// <returns>List of component objects ordered according to instantiation sequence</returns>
        IList<IComponentObject> AssembleComponents(IList<ComponentDescriptor> componentDescriptors, IKernel kernel);

        /// <summary>
        /// Accessor method to get the implementation of an interface
        /// </summary>
        /// <typeparam name="T">Fully-qualified name of the interface type</typeparam>
        /// <returns>interface instance object</returns>
        T GetInstance<T>();

        #endregion Methods
    }
}